<!DOCTYPE HTML>
<html>
<head>
    <title>Error</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
    <script src="/scripts/jquery.min.js"></script>
    <link rel="stylesheet" href="/scripts/miniui/themes/default/miniui.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/icons.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/bootstrap/skin.css">
    <script src="/scripts/miniui/miniui.js"></script>
</head>
<body>
<div id="form1" name="form1">
    <span style="width:80px;display:inline-block;">分类名称：</span>
    <input id="name" name="name" class="mini-textbox" required="true" style="width:155px;" value="<%=result.data[0].name%>"/>

    <span style="width:80px;display:inline-block;">类型标题：</span>
    <input class="mini-textbox"  id="classiftyTitle" style="width:155px;" value="<%=result.data[0].classiftyTitle%>"/>
    <br/><br/>

    <span style="width:80px;display:inline-block;">简介：</span>
    <input id="classiftyDescribe" name="name" class="mini-textbox" required="true" style="width:155px;" value="<%=result.data[0].classiftyDescribe%>" />


</div>
<div style="padding-top: 100px;text-align: center">
    <a class="mini-button " iconCls="icon-ok" onclick="addUserLevel()">确定</a>
    <a class="mini-button" iconCls="icon-cancel" onclick="onCancel">取消</a>
</div>
</body>
<script>
    var objectId = '<%-result.data[0].objectId%>'
    mini.parse();
    function addUserLevel() {
        var classiftyTitle = mini.get("classiftyTitle").getValue();
        var classiftyDescribe = mini.get("classiftyDescribe").getValue();
        var name = mini.get("name").getValue();
        console.log(classiftyTitle,classiftyDescribe,name)
        $.ajax({
            type: "POST",
            url: "/getdata/wxGroupType/edit",
            data:{
                objectId:objectId,
                name:name,
                classiftyTitle:classiftyTitle,
                classiftyDescribe:classiftyDescribe,
            },
            success: function (result) {
                if(result==1){
                    CloseWindow("save");
                }else{
                    alert("添加失败");
                    CloseWindow("save");
                }
            }
        })
    }
    //    关闭窗口
    function CloseWindow(action) {
        if (action == "close" && form.isChanged()) {
            if (confirm("数据被修改了，是否先保存？")) {
                return false;
            }
        }
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }
    function onOk(e) {
        SaveData();
    }
    function onCancel(e) {
        CloseWindow("cancel");
    }

</script>
</html>